package com.geekbang.lul.provider.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.geekbang.lul.dto.CustomerBalanceFreezeDTO;
import com.geekbang.lul.dto.CustomerDTO;
import com.geekbang.lul.provider.mapper.CustomerBalanceFreezeMapper;
import com.geekbang.lul.provider.mapper.CustomerMapper;
import com.geekbang.lul.service.provider.ProviderCustomerService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author nhsoft.lul
 */
@Service
public class ProviderCustomerServiceImpl implements ProviderCustomerService {

    @Autowired
    private CustomerMapper customerMapper;

    @Autowired
    private CustomerBalanceFreezeMapper customerBalanceFreezeMapper;

    @Override
    public CustomerDTO read(Integer customerId) {
        return customerMapper.read(customerId);
    }

    @Override
    public void saveBalanceFreeze(CustomerBalanceFreezeDTO customerBalanceFreezeDTO) {
        customerBalanceFreezeMapper.save(customerBalanceFreezeDTO);
    }

    @Override
    public void deleteBalanceFreeze(Integer customerId) {
        customerBalanceFreezeMapper.delete(customerId);
    }

    @Override
    public void updateBalance(CustomerDTO customerDTO) {
        customerMapper.updateBalance(customerDTO);
    }
}
